
import server from "./server";
export default{

    async getComments(id){
        return await server({
            method:'get',
            url:`/comment/selectCommentByPhotoId/${id}`
        })
    },

    async addComment(data){
        return await server({
            method:'post',
            url:'/comment/addComment',
            contentType:'application/x-www-form-urlencoded;charset=UTF-8',
            data:data
        })
    },

    // 获取用户回复
    async getReplyList(pageNum){
        return await server({
            method:'get',
            params:{
                pageNum:pageNum
            },
            url:`/comment/getCommentByUserId`
        })
    },

    // 删除评论
    async deleteComment(id){
        return await server({
            data:{
                photoId:id
            },
            method:'post',
            url:`/comment/deleteComment`
        })
    }
}